package com.heraleign.ws;

import org.apache.cxf.jaxws.JaxWsServerFactoryBean;

public class WSPublishCXF {
    public static void main(String[] args) {
        // 1、发布服务的工厂
        JaxWsServerFactoryBean factory= new JaxWsServerFactoryBean();

        // 2、设置服务地址
        factory.setAddress("http://localhost:8081/ws/hello");

        // 3、设置服务类
        factory.setServiceBean(new HelloServiceImpl());

        // 4、发布服务
        factory.create();

        System.out.println("使用cxf发布服务成功，端口8081......");
    }
}
